import unittest
from common.assertUtil import assertUtil
from api.login_api import LoginApi
import logging
from common.log_code import init_log_config


class TestLogin(unittest.TestCase):

    def test01_ok(self):
        rseq = LoginApi.login({"loginName": "sa", "loginPwd": "123456"})
        assertUtil(self, rseq, msg="操作成功", success=True)
        logging.debug(f'"loginName": "sa", "loginPwd": "123456"--登录成功')

    def test02_userErr(self):
        rseq = LoginApi.login({"loginName": "admi", "loginPwd": "123456"})
        assertUtil(self, rseq, msg="用户名或密码错误", success=False)


    def test02_pwdErr(self):
        rseq = LoginApi.login({"loginName": "admin1", "loginPwd": "000000"})
        assertUtil(self, rseq, msg="用户名或密码错误", success=False)


